<template>
  <div class="apply">
    <Navigation :logoName="logoName" :routeInfo="routeInfo"></Navigation>
    <div class="formContent">
        <ArbitDetail :basicInfo="basicInfo"></ArbitDetail>
        <div>
          <p class="title line arbitline">审核意见</p>
          <div class="verifyForm">
              <Form :model="formRight" label-position="right" :label-width="120">
                  <!-- <FormItem label="利息比率核算">
                      <InputNumber v-model="formRight.input1" style="width:200px"></InputNumber>&nbsp;&nbsp;&nbsp;%
                  </FormItem> -->
                  <FormItem label="附件资料正确性">
                      <RadioGroup v-model="formRight.input2">
                          <Radio label="1">确认无误</Radio>
                          <Radio label="0">资料有误</Radio>
                      </RadioGroup>
                  </FormItem>
                  <FormItem label="附件资料完整性">
                      <RadioGroup v-model="formRight.input3">
                          <Radio label="1">确认完整</Radio>
                          <Radio label="0">资料缺失</Radio>
                      </RadioGroup>
                  </FormItem>
                  <FormItem label="审核意见">
                      <RadioGroup v-model="formRight.input4" vertical>
                          <Radio label="1">审核通过</Radio>
                          <Radio label="2">不通过</Radio>
                      </RadioGroup>
                      <Input style="width:200px;position: absolute;top: 28px;" v-model="formRight.input5"  v-show="formRight.input4=='1'?false:true" />
                      
                  </FormItem>
                  <FormItem label="适用程序" v-show="formRight.input4==1">
                      <Select style="width:200px;" v-model="formRight.input6">
                          <Option value="简易程序">简易程序</Option>
                          <Option value="普通程序">普通程序</Option>
                      </Select>
                  </FormItem>
                  <!-- <FormItem label="等级">
                      <Select style="width:200px;" v-model="formRight.input7">
                          <Option value="1">A级</Option>
                          <Option value="0">B级</Option>
                      </Select>
                  </FormItem> -->
              </Form>
          </div>
          
        </div>
        <div class="show">
        <div class="btn-sty">
          <span class="btn btn-apply" @click="back">返回</span>
          <span class="btn btn-complete btn-arbit" @click="complete">完成</span>
        </div>
      </div>
      
    </div>
    
  </div>
</template>

<script>
import Navigation from '../common/navigation'
import ArbitDetail from '../common/arbitdetail'
export default {
  name: 'Verify',
  data(){
     return {
        logoName:'仲裁申请审核',
        routeInfo:'首页/仲裁审核受理/仲裁申请审核',
        meansCorrect:'',
        meansWhole:'',
        idea:'',
        basicInfo:{},
        applyINfo:false,
        unapplyINfo:false,
        unEvidence:false,
        evidence:[],
        basicInfos:this.$route.params.caseno,
        formRight: {
            input1: null,
            input2: '',
            input3: '',
            input4: '',
            input5: '',
            input6: '',
            // input7: ''
        }
     }
  },
  props: {
    msg: String
  },
  methods:{
    back(){
      this.$router.push('/Syspage/VerifycommissionerIndex')
    },
    unEvidenceM(){
      this.unEvidence=!this.unEvidence;
    },
    complete(){
      if(this.formRight.input2&&this.formRight.input3
        &&this.formRight.input4==1&&this.formRight.input6||
        this.formRight.input2&&this.formRight.input3
        &&this.formRight.input4==2){
          this.$http.post('/api'+this.urls.secVerifyCase,{
            // interestRatio:this.formRight.input1,
            attachmentCorrect:Number(this.formRight.input2),
            attachmentComplete:Number(this.formRight.input3),
            isApproval:Number(this.formRight.input4),
            // secretary_status:Number(this.formRight.input4),
            reason:this.formRight.input5,
            applicableProcedure:Number(this.formRight.input4)==1?this.formRight.input6:'普通程序',
            // level:Number(this.formRight.input7),
            caseNo:this.$route.params.caseno
          }).then((result)=>{
              if(result.data.code==200){
                this.$Message.success('审核成功');
                // setTimeout(()=>{
                    this.$router.push('/Syspage/verifycommissionerIndex');
                // },500)
              }else{
                this.$Message.error('审核失败');
              }
          }) 
      }else{
          this.$Message.warning('审核信息不能为空');
      }
        
    },
    detail(){
      
    },
    cancel(){

    },
    handleSubmit () {
      this.$router.push('/Syspage/ApplySecondForm')
    },
    applyIN(){
      this.applyINfo=!this.applyINfo;
    },
    unapplyIN(){
      this.unapplyINfo=!this.unapplyINfo;
    }
  },
  components:{Navigation,ArbitDetail},
  created(){
    this.$http.post('/api'+this.urls.getCaseDetail,{caseNo:this.basicInfos}).then((result)=>{
          if(result.data.code==200){
              this.basicInfo=result.data.data;
          }
    })
  }
  // created(){
  //     this.$http.get('/api'+this.urls.getCaseDetail+this.$route.params.caseno).then((result)=>{
  //         if(result.data.code==200){
  //           this.basicInfo=result.data.data.secretaryCaseDetail;
  //           this.evidence=result.data.data.secretaryCaseDetail.evidence?result.data.data.secretaryCaseDetail.evidence.split(','):[]
  //         }
  //     }) 
  // }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .show{
    margin:0 20px;
    /* padding-top: 30px; */
  }
  .btn-sty{
    margin-bottom: 20px;
  }
</style>
